package com.armani.mapper;

import com.armani.entity.Shopcar;
import com.armani.model.ShopCarModel;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @ClassName ShopcarMapper
 * @Description TODO
 * @Author Xinyibuzai
 * @Date 2021/11/29 14:12
 * @Version 1.0
 **/
public interface ShopcarMapper {
    /**
     * @MethodName listSearch
     * @Description TODO 
     * @Param startRow
     * @Param limit
     * @Param name 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/29 
     **/
    List<Shopcar> listSearch(@Param(value = "startRow") Integer startRow,
                             @Param(value = "limit") Integer limit,
                             @Param(value = "num") Integer num);
    /**
     * @MethodName getCount
     * @Description TODO 
     * @Param name 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/29 
     **/
    Integer getCount(@Param(value = "num") Integer num);
    /**
     * @MethodName update
     * @Description TODO 
     * @Param num
     * @Param userId
     * @Param skuId
     * @Param insertTime
     * @Param id 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/29 
     **/
    void update(@Param(value = "num") Integer num,
                @Param(value = "userId") Integer userId,
                @Param(value = "skuId") Integer skuId,
                @Param(value = "insertTime") Date insertTime,
                @Param(value = "id") Integer id);
    /**
     * @MethodName insert
     * @Description TODO 
     * @Param num
     * @Param userId
     * @Param skuId
     * @Param insertTime 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/29 
     **/
    void insert(@Param(value = "num") Integer num,
                @Param(value = "userId") Integer userId,
                @Param(value = "skuId") Integer skuId,
                @Param(value = "insertTime") Date insertTime);
    /**
     * @MethodName delete
     * @Description TODO 
     * @Param id 
     * @Return 
     * @Author Xinyibuzai
     * @Date 2021/11/29 
     **/
    void delete(@Param(value = "id") Integer id);

    /**
     * 查询用户购物车
     * @param userId 用户id
     * @return 购物车列表
     */
    List<ShopCarModel> selectByUserId(Integer userId);

    /**
     * 修改购物车商品数量
     * @param params
     * @return 影响行
     */
    Integer editNum(Map<String, Object> params);
}
